﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Unscrambler.Extensions
{
    public static class IntExtensions
    {
        public static string FormatSecondsAsTime(this Int32 seconds)
        {
            StringBuilder sb = new StringBuilder();
            if (seconds < 60)
            {
                sb.Append(seconds.ToString());
            }
            else if (seconds < 3600)
            {
                sb.Append(seconds / 60).Append(":").Append((seconds % 60).ToString("00"));
                 
            }
            else
            {
                sb.Append(seconds / 3600).Append(":").Append(((seconds % 3600)/60).ToString("00"));
            }

            return sb.ToString();
            
        }
    }
}
